#!/bin/bash

echo "=== Windows Style Taskbar 卸载脚本 ==="
echo ""

# 停止应用程序
echo "正在停止应用程序..."
./stop.sh

echo ""
echo "清理文件："

# 列出将要删除的文件
echo "以下文件和目录将被删除："
echo "  - build/ (编译输出)"
echo "  - *.app (应用程序包)"
echo ""

read -p "确定要删除这些文件吗? (y/N): " -n 1 -r
echo ""

if [[ $REPLY =~ ^[Yy]$ ]]; then
    # 删除构建文件
    if [ -d "build" ]; then
        rm -rf build/
        echo "✅ 已删除 build/ 目录"
    fi
    
    # 删除任何可能存在的.app文件
    find . -name "*.app" -type d -exec rm -rf {} + 2>/dev/null
    echo "✅ 已删除应用程序包"
    
    echo ""
    echo "🎉 卸载完成！"
    echo ""
    echo "源代码文件保留："
    echo "  - *.swift (源代码)"
    echo "  - *.sh (脚本)" 
    echo "  - Info.plist (配置)"
    echo "  - README.md (文档)"
    echo ""
    echo "如需完全删除，请手动删除整个目录"
else
    echo "❌ 取消卸载"
fi